package com.rockcent.mall.lib.repository;

import com.rockcent.mall.lib.domain.MerchantGiftPacket;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by DK on 16/10/9.
 */
@Repository
public interface MerchantGiftPacketRepository extends JpaRepository<MerchantGiftPacket, Long>, JpaSpecificationExecutor,MerchantGiftPacketRepositoryCustom {
    MerchantGiftPacket findByIdAndMerchantId(Long id, Long merchantId);

    List<MerchantGiftPacket> findByMerchantIdAndIdIn(Long id, List<Long> packetIds);

    List<MerchantGiftPacket> findByIdIn(List<Long> packetIds);

    MerchantGiftPacket findByIdAndMerchantIdAndMarketIdIsNull(Long id, Long merchantId);

    List<MerchantGiftPacket> findByMarketId(Long id);
}
